package com.nbicc.news.po;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.nbicc.news.vo.ExtInfoAble;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@ApiModel(value="新闻描述",description = "新闻信息的元数据(摘要等)")
@Data
public class NewsInfo implements ExtInfoAble {

    public final static String TABLE_NEWS_INFO = "news_info";

    @ApiModelProperty(value="新闻唯一id long类型")
    @JsonSerialize(using= ToStringSerializer.class)
    private long id;
    @ApiModelProperty(value="标题")
    private String title;
    @ApiModelProperty(value="摘要")
    private String digest;
    @ApiModelProperty(value="作者")
    private String author;
    @ApiModelProperty(value="创建时间")
    private Date createTime;

    @ApiModelProperty(value="新闻额外信息" ,
            notes = "visitCount:访问次数(只记录匿名接口流量)",
            example = "visitCount：5")
    private Map<String , Object> extInfo = new HashMap<>();

}
